class ParamsTypeError(Exception):
    def __init__(self, err):
        super().__init__(self)
        self.err = err

    def __str__(self):
        return self.err


def fibonacci_f(number):
    x, y = 0, 1
    fibonacci_list = [x, y]
    if number == 1:
        return x
    else:
        for i in range(number-1):
            x, y = y, x+y
            fibonacci_list.append(y)
        return fibonacci_list


def fibonacci_w(number):
    x, y = 0, 1
    fibonacci_list = [x, y]
    n = 0
    if number == 1:
        return x
    else:
        while n < number-1:
            x, y = y, x + y
            fibonacci_list.append(y)
            n += 1
        return fibonacci_list


if __name__ == "__main__":
    while True:
        number = input("请输入数据：")
        if number == "q":
            break
        try:
            print(fibonacci_f(int(number)))
            print(fibonacci_w(int(number)))
        except Exception:
            raise ParamsTypeError("参数不可以转换成int类型")
